/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interfaz;

import Controladores.ControladorCompeticion;
import java.awt.BorderLayout;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Souhaila, Abdelilah
 */
public class InterfazCompeticion extends javax.swing.JPanel {

    private static InterfazCompeticion Instancia = null;
    private InterfazJornada interfaz_jornada= null;
    private Boolean es_gestor;
    
    public static InterfazCompeticion getInstancia() {
         if (Instancia==null){
            Instancia = new InterfazCompeticion();
        }
        return Instancia;
    }

    /**
     * Creates new form InterfazCompeticion
     */
    public InterfazCompeticion() {
        initComponents();
        GroupGeneroCrear.add(M);
        GroupGeneroCrear.add(F);
        
        jPanel3.setLayout(new BorderLayout() );
        jPanel3.add(InterfazJornada.getInstancia(), BorderLayout.CENTER);
        javax.swing.JPanel Jpanel_Cancelar2 = new javax.swing.JPanel();
        jPanel3.add(Jpanel_Cancelar2, BorderLayout.SOUTH);
        Jpanel_Cancelar2.setLayout(new BorderLayout() );
        JBoton_Cancelar2.setPreferredSize(new java.awt.Dimension(100, 50));
        Jpanel_Cancelar2.add(JBoton_Cancelar2, BorderLayout.EAST);   
    }
    
    public void mostrarCompeticion(String nomCompt, String sexoCompt,String catCompt){
        
        NomCompeticion.setText(nomCompt);
        if("M".equals(sexoCompt)){
                M.setSelected(true);
        }else {
                F.setSelected(true);
        }
        Categoria.setSelectedItem(catCompt);
            
    }
    
    public String[] cargarDatosFormulario() {
        String [] Datos = new String[3];
        Datos[0] = this.NomCompeticion.getText();
        if(M.isSelected())
        {
            Datos[1] = "M";
        }else if (F.isSelected())
        {
            Datos[1] = "F";
        }else {
            Datos[1] = null;
        }
        Datos[2] = (String) this.Categoria.getSelectedItem();
        
        return Datos;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        GroupGeneroConsulta = new javax.swing.ButtonGroup();
        GroupGeneroCrear = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        NomCompeticion = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        M = new javax.swing.JRadioButton();
        F = new javax.swing.JRadioButton();
        jLabel4 = new javax.swing.JLabel();
        Categoria = new javax.swing.JComboBox();
        JBoton_Crear = new javax.swing.JButton();
        JBoton_Cancelar1 = new javax.swing.JButton();
        JButton_CrearJornada = new javax.swing.JButton();
        JButton_ConsultarJornada = new javax.swing.JButton();
        JButton_ConsultClasificacion = new javax.swing.JButton();
        JButton_Consultar = new javax.swing.JButton();
        JButton_Modificar = new javax.swing.JButton();
        JButton_Eliminar = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        JTable1 = new javax.swing.JTable();
        Button_addEquipoCompeticion = new javax.swing.JButton();
        Button_deleteEquipoCompeticion = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jButtonConsultar_Competicion = new javax.swing.JButton();
        jButtonCrear_Competicion = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        JBoton_Cancelar2 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        Button_Cancelar3 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable_Equipos = new javax.swing.JTable();
        Button_addEquipoCompt = new javax.swing.JButton();
        Button_deleteEquipoCompt = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        Button_Cancelar4 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable_clasificacion = new javax.swing.JTable();

        setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setFont(new java.awt.Font("Andalus", 1, 24)); // NOI18N
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/FCBGranada2.PNG"))); // NOI18N
        jLabel1.setText("FUNDACION CLUB BALONCESTO GRANADA");

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setVisible(false);

        jLabel2.setText("Nombre de competicion");

        jLabel3.setText("Genero");

        M.setText("M");

        F.setText("F");

        jLabel4.setText("Categoria");

        Categoria.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", "Benjamin", "Alevin", "Infantil", "Cadete", "Junior" }));

        JBoton_Crear.setText("Crear");
        JBoton_Crear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBoton_CrearActionPerformed(evt);
            }
        });

        JBoton_Cancelar1.setText("Cancelar");
        JBoton_Cancelar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBoton_Cancelar1ActionPerformed(evt);
            }
        });

        JButton_CrearJornada.setText("Crear Jornada");
        JButton_CrearJornada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_CrearJornadaActionPerformed(evt);
            }
        });

        JButton_ConsultarJornada.setText("Consultar Jornada");
        JButton_ConsultarJornada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_ConsultarJornadaActionPerformed(evt);
            }
        });

        JButton_ConsultClasificacion.setText("Consultar Clasificacion");
        JButton_ConsultClasificacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_ConsultClasificacionActionPerformed(evt);
            }
        });

        JButton_Consultar.setText("Consultar");
        JButton_Consultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_ConsultarActionPerformed(evt);
            }
        });

        JButton_Modificar.setText("Modificar");
        JButton_Modificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_ModificarActionPerformed(evt);
            }
        });

        JButton_Eliminar.setText("Eliminar");
        JButton_Eliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButton_EliminarActionPerformed(evt);
            }
        });

        JTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre Competicion", "Genero", "Categoria"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        JTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                JTable1MouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(JTable1);
        JTable1.getAccessibleContext().setAccessibleParent(jLabel2);

        Button_addEquipoCompeticion.setText("Añadir Equipo");
        Button_addEquipoCompeticion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_addEquipoCompeticionActionPerformed(evt);
            }
        });

        Button_deleteEquipoCompeticion.setText("Eliminar Equipo");
        Button_deleteEquipoCompeticion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_deleteEquipoCompeticionActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGap(0, 895, Short.MAX_VALUE)
                        .addComponent(JBoton_Cancelar1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 168, Short.MAX_VALUE)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel2)
                                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel4))
                                        .addGap(28, 28, 28)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addComponent(M, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(F))
                                            .addComponent(Categoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(NomCompeticion, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(Button_deleteEquipoCompeticion, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(Button_addEquipoCompeticion, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(6, 6, 6)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JButton_ConsultarJornada)
                                    .addComponent(JButton_CrearJornada, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(JButton_ConsultClasificacion, javax.swing.GroupLayout.Alignment.TRAILING)))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(JBoton_Crear, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(JButton_Consultar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(JButton_Modificar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(JButton_Eliminar)
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())))
        );

        jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Button_addEquipoCompeticion, Button_deleteEquipoCompeticion, JButton_ConsultClasificacion, JButton_ConsultarJornada, JButton_CrearJornada});

        jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {JBoton_Crear, JButton_Consultar, JButton_Eliminar, JButton_Modificar});

        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(NomCompeticion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(M)
                            .addComponent(F))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(Categoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(JButton_ConsultClasificacion, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(JButton_ConsultarJornada)
                                    .addComponent(Button_deleteEquipoCompeticion))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(JButton_CrearJornada))
                            .addComponent(Button_addEquipoCompeticion, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 115, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JBoton_Crear, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JButton_Consultar)
                    .addComponent(JButton_Modificar)
                    .addComponent(JButton_Eliminar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JBoton_Cancelar1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Button_addEquipoCompeticion, Button_deleteEquipoCompeticion, JButton_ConsultClasificacion, JButton_ConsultarJornada, JButton_CrearJornada});

        jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {JBoton_Crear, JButton_Consultar, JButton_Eliminar, JButton_Modificar});

        jButtonConsultar_Competicion.setText("Consultar Competicion");
        jButtonConsultar_Competicion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConsultar_CompeticionActionPerformed(evt);
            }
        });

        jButtonCrear_Competicion.setText("Crear Competicion");
        jButtonCrear_Competicion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCrear_CompeticionActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(11, Short.MAX_VALUE)
                .addComponent(jButtonCrear_Competicion, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButtonConsultar_Competicion)
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonConsultar_Competicion, jButtonCrear_Competicion});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(64, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonConsultar_Competicion)
                    .addComponent(jButtonCrear_Competicion, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonConsultar_Competicion, jButtonCrear_Competicion});

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        JBoton_Cancelar2.setText("Cancelar");
        JBoton_Cancelar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBoton_Cancelar2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(905, Short.MAX_VALUE)
                .addComponent(JBoton_Cancelar2, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(445, Short.MAX_VALUE)
                .addComponent(JBoton_Cancelar2, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        Button_Cancelar3.setText("Cancelar");
        Button_Cancelar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_Cancelar3ActionPerformed(evt);
            }
        });

        jTable_Equipos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre Equipo", "Genero", "Categoria", "Estado"
            }
        ));
        jScrollPane1.setViewportView(jTable_Equipos);

        Button_addEquipoCompt.setText("Añadir a Competicion");
        Button_addEquipoCompt.setMaximumSize(new java.awt.Dimension(139, 23));
        Button_addEquipoCompt.setMinimumSize(new java.awt.Dimension(139, 23));
        Button_addEquipoCompt.setPreferredSize(new java.awt.Dimension(139, 23));
        Button_addEquipoCompt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_addEquipoComptActionPerformed(evt);
            }
        });

        Button_deleteEquipoCompt.setText("Eliminar De Competicion");
        Button_deleteEquipoCompt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_deleteEquipoComptActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(Button_Cancelar3, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(48, 48, 48)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 542, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 230, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(Button_addEquipoCompt, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Button_deleteEquipoCompt))))
                .addContainerGap())
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Button_addEquipoCompt, Button_deleteEquipoCompt});

        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(114, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(Button_addEquipoCompt, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Button_deleteEquipoCompt)))
                .addGap(32, 32, 32)
                .addComponent(Button_Cancelar3, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Button_addEquipoCompt, Button_deleteEquipoCompt});

        Button_Cancelar4.setText("Cancelar");
        Button_Cancelar4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button_Cancelar4ActionPerformed(evt);
            }
        });

        jTable_clasificacion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "posicion", " Equipo", "Puntos"
            }
        ));
        jScrollPane3.setViewportView(jTable_clasificacion);
        jTable_clasificacion.getColumnModel().getColumn(0).setMaxWidth(70);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(Button_Cancelar4, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(Button_Cancelar4, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 489, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(107, 107, 107))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jPanel2, jPanel3, jPanel4, jPanel5});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel2, jPanel3, jPanel4, jPanel5});

    }// </editor-fold>//GEN-END:initComponents

    private void jButtonCrear_CompeticionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCrear_CompeticionActionPerformed
 
        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        JTable1.setEnabled(false);
        
        this.JBoton_Crear.setEnabled(true);
        this.JBoton_Cancelar1.setEnabled(true);
        this.JButton_ConsultClasificacion.setEnabled(false);
        this.JButton_ConsultarJornada.setEnabled(false);
        this.JButton_CrearJornada.setEnabled(false);
        this.JButton_Consultar.setEnabled(false);
        this.JButton_Modificar.setEnabled(false);
        this.JButton_Eliminar.setEnabled(false);
        this.Button_addEquipoCompeticion.setEnabled(false);
        this.Button_deleteEquipoCompeticion.setEnabled(false);
        
        limpiarInterfaz();
    }//GEN-LAST:event_jButtonCrear_CompeticionActionPerformed

    private void jButtonConsultar_CompeticionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConsultar_CompeticionActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        JTable1.setEnabled(false);  
        this.JBoton_Crear.setEnabled(false);
        this.JBoton_Cancelar1.setEnabled(true);
        this.JButton_ConsultClasificacion.setEnabled(false);
        this.JButton_ConsultarJornada.setEnabled(false);
        this.JButton_CrearJornada.setEnabled(false);
        this.JButton_Consultar.setEnabled(true);
        this.JButton_Modificar.setEnabled(false);
        this.JButton_Eliminar.setEnabled(false);
        this.Button_addEquipoCompeticion.setEnabled(false);
        this.Button_deleteEquipoCompeticion.setEnabled(false);
        limpiarInterfaz();
    }//GEN-LAST:event_jButtonConsultar_CompeticionActionPerformed


    private void JButton_ConsultClasificacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_ConsultClasificacionActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(true);
        
        ControladorCompeticion.getInstancia().getClasificacion();
    }//GEN-LAST:event_JButton_ConsultClasificacionActionPerformed

    private void JButton_EliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_EliminarActionPerformed
           int n=JOptionPane.showConfirmDialog(null, "¿Seguro que quieres eliminar la competicion?",
            "Atención", JOptionPane.YES_NO_OPTION);
        if (n==JOptionPane.YES_OPTION) {
            if(ControladorCompeticion.getInstancia().eliminarCompeticion()){
                limpiarInterfaz();
                limpiarTabla(); 
            }
       }
    }//GEN-LAST:event_JButton_EliminarActionPerformed

    private void JBoton_CrearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBoton_CrearActionPerformed

       if(! ControladorCompeticion.getInstancia().consultarCompeticion(this.cargarDatosFormulario())) {
            if(ControladorCompeticion.getInstancia().addCompeticion(this.cargarDatosFormulario())) {
                limpiarInterfaz();
                limpiarTabla(); 
            }
        }else{
               mostrarMensaje("EXISTE UNA COMPETICION CON LOS MISMOS DATOS", "AVISO", 0);
       }
    }//GEN-LAST:event_JBoton_CrearActionPerformed

    private void JButton_ConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_ConsultarActionPerformed
         
        if(ControladorCompeticion.getInstancia().consultarCompeticion(this.cargarDatosFormulario())){
            
            jPanel1.setVisible(false);
            jPanel2.setVisible(true);
            jPanel3.setVisible(false);
            jPanel4.setVisible(false);
            jPanel5.setVisible(false);  
            
            JTable1.setEnabled(true);
            this.JBoton_Crear.setEnabled(false);
            this.JBoton_Cancelar1.setEnabled(true);
            this.JButton_ConsultClasificacion.setEnabled(true);
            this.JButton_ConsultarJornada.setEnabled(true);
            if(this.es_gestor) {
                this.JButton_CrearJornada.setEnabled(true);
                this.JButton_Modificar.setEnabled(true);
                this.JButton_Eliminar.setEnabled(true);
                this.Button_addEquipoCompeticion.setEnabled(true);
                this.Button_deleteEquipoCompeticion.setEnabled(true);
                
            }else {
                this.JButton_CrearJornada.setEnabled(false);
                this.JButton_Modificar.setEnabled(false);
                this.JButton_Eliminar.setEnabled(false);
                this.Button_addEquipoCompeticion.setEnabled(false);
                this.Button_deleteEquipoCompeticion.setEnabled(false);
            }
            this.JButton_Consultar.setEnabled(false);
        } else { // No se ha encontrado competicion
                this.mostrarMensaje("COMPETICION NO ENCONTRADA", "ERROR", 0);
            }
    }//GEN-LAST:event_JButton_ConsultarActionPerformed

    private void JBoton_Cancelar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBoton_Cancelar1ActionPerformed
        
        limpiarInterfaz();
        limpiarTabla(); 
        jPanel1.setVisible(true);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
    }//GEN-LAST:event_JBoton_Cancelar1ActionPerformed

    private void JButton_ModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_ModificarActionPerformed
        ControladorCompeticion.getInstancia().modificarCompeticion(this.cargarDatosFormulario());
    }//GEN-LAST:event_JButton_ModificarActionPerformed

    private void JButton_ConsultarJornadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_ConsultarJornadaActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        if (interfaz_jornada==null){
            interfaz_jornada=InterfazJornada.getInstancia();
            jPanel3.add(interfaz_jornada); 
        }
        interfaz_jornada.inicializar_Consultar(es_gestor);
        interfaz_jornada.setVisible(true);    
        jPanel3.setVisible(true);

    }//GEN-LAST:event_JButton_ConsultarJornadaActionPerformed

    private void JButton_CrearJornadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButton_CrearJornadaActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        if (interfaz_jornada==null){
            interfaz_jornada=InterfazJornada.getInstancia();
            jPanel3.add(interfaz_jornada);
        }        
        interfaz_jornada.inicializar_Crear();
        interfaz_jornada.setVisible(true);
        jPanel3.setVisible(true);
    }//GEN-LAST:event_JButton_CrearJornadaActionPerformed

    private void JBoton_Cancelar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBoton_Cancelar2ActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        if(interfaz_jornada!= null){
            interfaz_jornada.setVisible(false);
        }
        jPanel3.setVisible(false);
    }//GEN-LAST:event_JBoton_Cancelar2ActionPerformed

    private void JTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JTable1MouseClicked
        
        int row_index = JTable1.getSelectedRow();
        if(JTable1.isEnabled()){
            mostrarCompeticion(JTable1.getValueAt(row_index, 0).toString(),
                            JTable1.getValueAt(row_index, 1).toString(),
                            JTable1.getValueAt(row_index, 2).toString());
            ControladorCompeticion.getInstancia().actualizarCompeticionActiva(row_index);
        }
    }//GEN-LAST:event_JTable1MouseClicked

    private void Button_addEquipoCompeticionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_addEquipoCompeticionActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel4.setVisible(true);
        jPanel5.setVisible(false);
        
        limpiarTablaEquipos();
        ControladorCompeticion.getInstancia().listarEquiposActivos();
        Button_addEquipoCompt.setEnabled(true);
        Button_deleteEquipoCompt.setEnabled(false);
    }//GEN-LAST:event_Button_addEquipoCompeticionActionPerformed

    private void Button_deleteEquipoCompeticionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_deleteEquipoCompeticionActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel4.setVisible(true);
        jPanel5.setVisible(false);
        
        limpiarTablaEquipos();
        ControladorCompeticion.getInstancia().listarEquiposEnCompeticion();
        Button_addEquipoCompt.setEnabled(false);
        Button_deleteEquipoCompt.setEnabled(true);
    }//GEN-LAST:event_Button_deleteEquipoCompeticionActionPerformed

    private void Button_Cancelar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_Cancelar3ActionPerformed
        
        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        if(interfaz_jornada!= null){
            interfaz_jornada.setVisible(false);
        }
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
    }//GEN-LAST:event_Button_Cancelar3ActionPerformed

    private void Button_addEquipoComptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_addEquipoComptActionPerformed
                
        int row_index = jTable_Equipos.getSelectedRow();
        if(row_index!=-1){
            String Datos[] = new String[4];
            Datos[0]= jTable_Equipos.getValueAt(row_index, 0).toString();
            Datos[1]= jTable_Equipos.getValueAt(row_index, 1).toString();
            Datos[2]= jTable_Equipos.getValueAt(row_index, 2).toString();
            Datos[3]= jTable_Equipos.getValueAt(row_index, 3).toString();
            //System.out.println(Datos[0]+" "+Datos[1]+" "+Datos[2]+" "+Datos[3]);
            ControladorCompeticion.getInstancia().addParticipa(Datos);
        }
    }//GEN-LAST:event_Button_addEquipoComptActionPerformed

    private void Button_deleteEquipoComptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_deleteEquipoComptActionPerformed
        
        int row_index = jTable_Equipos.getSelectedRow();
        if(row_index!=-1){
            String Datos[] = new String[4];
            Datos[0]= jTable_Equipos.getValueAt(row_index, 0).toString();
            Datos[1]= jTable_Equipos.getValueAt(row_index, 1).toString();
            Datos[2]= jTable_Equipos.getValueAt(row_index, 2).toString();
            Datos[3]= jTable_Equipos.getValueAt(row_index, 3).toString();
            //System.out.println(Datos[0]+" "+Datos[1]+" "+Datos[2]+" "+Datos[3]);
            ControladorCompeticion.getInstancia().deleteParticipa(Datos);
        }
    }//GEN-LAST:event_Button_deleteEquipoComptActionPerformed

    private void Button_Cancelar4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_Cancelar4ActionPerformed
        jPanel1.setVisible(false);
        jPanel2.setVisible(true);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
    }//GEN-LAST:event_Button_Cancelar4ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Button_Cancelar3;
    private javax.swing.JButton Button_Cancelar4;
    private javax.swing.JButton Button_addEquipoCompeticion;
    private javax.swing.JButton Button_addEquipoCompt;
    private javax.swing.JButton Button_deleteEquipoCompeticion;
    private javax.swing.JButton Button_deleteEquipoCompt;
    private javax.swing.JComboBox Categoria;
    private javax.swing.JRadioButton F;
    private javax.swing.ButtonGroup GroupGeneroConsulta;
    private javax.swing.ButtonGroup GroupGeneroCrear;
    private javax.swing.JButton JBoton_Cancelar1;
    private javax.swing.JButton JBoton_Cancelar2;
    private javax.swing.JButton JBoton_Crear;
    private javax.swing.JButton JButton_ConsultClasificacion;
    private javax.swing.JButton JButton_Consultar;
    private javax.swing.JButton JButton_ConsultarJornada;
    private javax.swing.JButton JButton_CrearJornada;
    private javax.swing.JButton JButton_Eliminar;
    private javax.swing.JButton JButton_Modificar;
    private javax.swing.JTable JTable1;
    private javax.swing.JRadioButton M;
    private javax.swing.JTextField NomCompeticion;
    private javax.swing.JButton jButtonConsultar_Competicion;
    private javax.swing.JButton jButtonCrear_Competicion;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable_Equipos;
    private javax.swing.JTable jTable_clasificacion;
    // End of variables declaration//GEN-END:variables

    void inicializar(Boolean esgestor) {
        
        es_gestor = esgestor;
        jPanel1.setVisible(true);
        jPanel2.setVisible(false);
        jPanel3.setVisible(false);
        jPanel4.setVisible(false);
        jPanel5.setVisible(false);
        
        if (!es_gestor){
            this.jButtonCrear_Competicion.setEnabled(false);
        }
         limpiarInterfaz();
         limpiarTabla(); 
    }

    public void mostrarMensaje(String mensaje, String titulo, int i) {
        JOptionPane.showMessageDialog(null, mensaje, titulo, i);
    }
    
    
      /**
     * Método que muestra un nombre y unos apellidos en una fila de la tabla
     * @param fila número de fila en la que mostrar los datos
     * @param Nombre Nombre a mostrar en la primera columna de la fila
     * @param Apellidos Apellidos a mostrar en la primera columna de la fila
     * @return void
     */
    public void add_Competicion_Tabla(int fila, String Nombre, String Genero, String Categoria){
        
        DefaultTableModel temp = (DefaultTableModel) JTable1.getModel();
        if(fila==JTable1.getRowCount()){
            Object nuevo[] = {fila+1, "", "",""};
            temp.addRow(nuevo);
        }
        this.JTable1.setValueAt(Nombre, fila, 0);
        this.JTable1.setValueAt(Genero, fila, 1);
        this.JTable1.setValueAt(Categoria, fila, 2);
    }
   
   public void add_Equipo_Tabla(int fila, String Nombre, String Genero, String Categoria, String estado){
       
       DefaultTableModel temp = (DefaultTableModel) jTable_Equipos.getModel();
       if(fila==jTable_Equipos.getRowCount()){
            Object nuevo[] = {fila+1, "", "","", ""};
            temp.addRow(nuevo);
        }
        this.jTable_Equipos.setValueAt(Nombre, fila, 0);
        this.jTable_Equipos.setValueAt(Genero, fila, 1);
        this.jTable_Equipos.setValueAt(Categoria, fila, 2);
        this.jTable_Equipos.setValueAt(estado, fila, 3);
        
    }
      public void add_Clasificacion_Tabla(int fila, String Nombre, Integer Puntos){
       
       DefaultTableModel temp = (DefaultTableModel) jTable_clasificacion.getModel();
       if(fila==jTable_clasificacion.getRowCount()){
            Object nuevo[] = {fila+1, "", "", ""};
            temp.addRow(nuevo);
        }
        this.jTable_clasificacion.setValueAt(fila+1, fila, 0);
        this.jTable_clasificacion.setValueAt(Nombre, fila, 1);
        this.jTable_clasificacion.setValueAt(Puntos, fila, 2);  
    }
    
    public void limpiarInterfaz() {
        
        NomCompeticion.setText("");
        GroupGeneroCrear.clearSelection();
        Categoria.setSelectedIndex(0);
        
    }

    public void limpiarTabla(){
 
        DefaultTableModel temp = (DefaultTableModel) JTable1.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        JTable1.clearSelection();
    }

    public void limpiarTablaEquipos(){
 
        DefaultTableModel temp = (DefaultTableModel) jTable_Equipos.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        jTable_Equipos.clearSelection();
    }
    public void limpiarTablaClasificacion(){
 
        DefaultTableModel temp = (DefaultTableModel) jTable_clasificacion.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        jTable_clasificacion.clearSelection();
    }
}

